package com.hzdl.flower.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.flower.bean.Admin;
import com.hzdl.flower.bean.User;
import com.hzdl.flower.mapper.AuserMapper;
import com.hzdl.flower.service.AuserService;
import com.hzdl.flower.vo.AdminVo;
import com.hzdl.flower.vo.UserVo;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuserServiceImpl implements AuserService {
    @Autowired
    private AuserMapper aum;




    @Override
    public PageInfo<User> findUser(UserVo userVo) {
        PageHelper.startPage(userVo.getPage(),userVo.getLimit());
        List<User> users = aum.findUser(userVo);
        PageInfo pageInfo = new PageInfo(users);
        return pageInfo;
    }

    @Override
    public int addUser(UserVo userVo) {
        return aum.addUser(userVo);
    }

    @Override
    public int deleteUser(Integer id) {
        return aum.deleteUser(id);
    }

    @Override
    public int updateUser(UserVo userVo)
    {
        return aum.updateUser(userVo);
    }

    @Override
    public User findById(String id) {
        return findById(id);
    }



    @Override
    public List<User> statAddress() {
        return aum.statAddress();
    }


}
